<?
die("ok11");
set_time_limit(1000);

require_once("../config/dbconn.php");require_once("../config/powercls.php");

if (!$test) $test=1;

$sql="select * from {$db_prefix}transfer where toptype=1 and isok=0";
$result=$db->query($sql);
if ($db->num_rows($result)==0) die("ok了");
while($rs=$db->fetch_array($result)){
	$price=$rs['price'];
	$sqlgx="update {$db_prefix}users set jjprice=jjprice-'$price' where username='".$rs['username']."'";
	$db->query($sqlgx);
	$sqlgx="update {$db_prefix}transfer set isok=1 where id='".$rs['id']."'";
	$db->query($sqlgx);
}
$db->free_result($result);

echo "ok";
$test++;
echo "<script>location.href='test2.php?test={$test}';</script>";exit();
?>